<?php

class Client extends AppModel {
    
    // define model name
    var $name = 'Client';
    
    // define model schema
    var $schema = array(
        'id'                        => array('type' => 'int'),
        'full_name'                 => array('type' => 'string'),
        'email'                     => array('type' => 'string'),
        'address'                   => array('type' => 'string'),
        'phone'                     => array('type' => 'string'),
        'personal_id_type'          => array('type' => 'int'),
        'personal_id_number'        => array('type' => 'string'),
        'created'                   => array('type' => 'datetime'),
        'deletedOn'                 => array('type' => 'datetime')
    );
    
    // define validation rules
    var $validate = array();
      
    public function checkIdType($idType = null) {
        return (key_exists($idType,  $this->getClientIdTypes()));
    }
    
    public function getNames() {
        $clients = $this->getActiveRecords();
        foreach($clients as $client) {
            $dbClients[$client['Client']['id']] = $client['Client']['full_name'];
        }
    }
    
    
}

?>